home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 21
/
Cream of the Crop 21 (Terry Blount) (October 1996).iso
/
editor
/
txtab608.zip
/
TXTABLE.DOC
< prev
next >
Wrap
Text File
|
1996-07-19
|
24KB
|
513 lines
TXTABLE.DOC 1 Revised: 07-19-96
This program creates tables from an ASCII text input file. Easier to maintain
than most word processing tables, the program automatically handles alignment
and such. Features:
* Creates tables which can be (at this point) up to 10 columns wide.
* Automatically sets table column widths but you can override this.
* Allows flexibility in terms of alignment, borders, titles, and
page lengths.
* You can either use a straight ASCII text input file (typically one
record per cell) or else a pseudo-HTML input file
* If you use the optional imbedded HTML stuff, you can have more than one
table per input file.
The TXTABLE.EXE input file:
TXTABLE.EXE works off an ASCII text input file which basically tells it what
goes in each cell. This file can be created and maintained by hand.
(A sample file, TXTABLE2.SAM, should have been included in the ZIP file. It's
used as the basis of the example shown below. Feel free to try it out using
"TXTABLE TXTABLE2.SAM".)
Tables can be indicated in this file in one of two ways. The first is a method
which doesn't use HTML commands and basically expects one cell of data per line
on input. The second method is based on a limited version of the HTML coding
for tables.
You will notice that the sample file actually mixes the two techniques in the
same file. If this is done, the HTML-based table(s) must appear after the
one-line/one-cell model.
Using format one (non-HTML):
Each record in the input file is the contents of a single cell. Long lines are
automatically wrapped on output by the program. For example, if you have a
table that looks like this:
╔═════════════╦══════════════════╤═════════════════════════════════════════════╗
║ Character ║ Actor/Actress │ Viewpoint ║
╠═════════════╬══════════════════╪═════════════════════════════════════════════╣
║ Fox Mulder ║ David Duchovny │ Searching for the truth about his sister. ║
║ ║ │ Conspiracy under every rock. ║
╟─────────────╫──────────────────┼─────────────────────────────────────────────╢
║ Dana Scully ║ Gillian Anderson │ Science is god. However, strong religious ║
║ ║ │ beliefs provide second foundation. ║
╚═════════════╩══════════════════╧═════════════════════════════════════════════╝
(This table was generated by the TXTABLE command.)
TXTABLE.DOC 2 Revised: 07-19-96
The input file would consist of the nine cells shown above, in the order they
are shown. In this case, the input file was the following:
Character
Actor/Actress
Viewpoint
Fox Mulder
David Duchovny
Searching for the truth about his sister. Conspiracy under every rock.
Dana Scully
Gillian Anderson
Science is god. However, strong religious beliefs provide second foundation.
Leading spaces are removed by the program for data lines.
You can embed comment lines within the input file. Comments are any lines that
begin with a colon (":"), semicolon (";"), or slash-asterisk pair ("/*"). These
special characters have to begin in column 1. The typical use for comments
would be to indicate where table lines begin and what parameters are suggested
for this table. For example, a commented input file for this example might be
the following:
/* TXTABLE2.SAM
Character
Actor/Actress
Viewpoint
/*
Fox Mulder
David Duchovny
Searching for the truth about his sister. Conspiracy under every rock.
/*
Dana Scully
Gillian Anderson
Science is god. However, strong religious beliefs provide second foundation.
One advantage of this approach is that it makes it very easy to move rows
around, something which I could never figure out how to do in WordPerfect.
A blank line means an empty cell.
The cell contents can include embedded decimal and hexadecimal strings
(including space representations) if desired (see BRUCEHEX.DOC file). If you
want to force a new line within a cell (e.g. "Actor/" and then have "Actress"
on the next line), include the representation of a carriage return/linefeed
within the line. For example: Actor/\013\010Actress.
If you have a very long cell, you can split the line in your input file into
multiple lines. To do this, end the line(s) to be continued with the
continuation indicator, which initially defaults to "__". For example,
This cell consists of a number of words__
so it's been split into multiple lines to make it easier__
to read in the input file.
Leading spaces are ignored by the program (except for comments) and it's much
easier to read the lines if you indent the continued lines.
TXTABLE.DOC 3 Revised: 07-19-96
Line continuations in the input file has no bearing on where the cells will be
wrapped in the final table. That's based exclusively on cell widths and the
\013\010 indicators.
Note that the program automatically adds one space when it joins the lines
unless a space is already there. So the above example will have the cell shown
based on "words so" and "easier to".
Parts of a table and their alignment:
Each table consists of a header section (the first line of cells) and a stub
(the left-most column of cells). The contents of the cells within each of these
sections can be positioned independently from the body of the table. By
default, the contents of the headers are centered, then the stubs are flush
left, and then body of the table is also flush left. The uppermost left cell is
considered to be part of the header, not the stub.
Numeric values are positioned totally independent of everything else. By
default, they are positioned flush right. At this point, the program doesn't
support decimal alignment so just make sure you have the same number of decimal
places for every cell in the column.
In addition, you can have an optional title in your table. The title can be as
long as you want it; it will be automatically wrapped and centered based on your
page width. Note that the only way to have a title is to embed it in your input
file. This is explained shortly in the "Specifying parameters" section.
TXTABLE.DOC 4 Revised: 07-19-96
Using format two (HTML based):
The second format for the input file is based on the HTML standard. Having said
this, it does *not* the HTML standard; just a subset of it.
HTML uses indicators enclosed in "<..>" characters to indicate what's to happen.
Unlike the HTMSTRIP command (also released by freeware by this author), TXTABLE
only supports certain HTML codes:
<BR> Line is to be split at this point
<CAPTION>..</CAPTION> Title of table (<TITLE>..</TITLE> works too)
<TABLE>..</TABLE> Table definition
<TD>..</TD> Table cell data contents
<TH>..</TH> Table header data contents
<HR> Horizontal rule is to appear here
<TITLE>..</TITLE> Title of table (<CAPTION>..</CAPTION> works too)
<TR>..</TR> Table row
<VERBATIM>..</VERBATIM> Block which follows appears outside of a
table block and is to be printed verbatim.
A typical table looks like the following:
<TABLE>
<CAPTION>Main exports by country</CAPTION>
<TR><TH>Table stub</TH><TH>Col 1</TH><TH>Col 2</TH></TR>
<TR><TD>China</TD>
<TD>Textiles</TD>
<TD>Apparel</TD></TR>
<TR><TD>Japan</TD>
<TD>Automobiles</TD>
<TD>Electronics</TD></TR>
</TABLE>
This input file would result in the following output: